<?php

namespace Database\Seeders;

use App\Models\Vuser;
use Illuminate\Database\Seeder;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //

//        //清空数据表Z
//        Vuser::truncate();
//
//        //添加模拟数据
//        factory(Vuser::class,100)->create();
//
//        //规定id=1的用户名为admin
//        Vuser::where('id',1)->update(['username'=>'admin']);


        DB::table('vusers')->insert([
            [
                'article_name'=>'三国演义1',
                'author_id'=>1
            ],
            [
                'article_name'=>'三国演义2',
                'author_id'=>2
            ]
            ,[
                'article_name'=>'三国演义3',
                'author_id'=>3
            ]
        ]);

    }
}
